package org.ResearchProject.exception;

import lombok.Getter;

/**
 * 内部异常
 *
 * @author Ruci & Houznangxu
 * @since 2022/3/1 11:23
 */
@Getter
public class InnerException extends RuntimeException {

    /**
     * 异常code
     */
    private final String code;

    /**
     * 异常内容
     */
    private final String msg;

    public InnerException(String msg) {
        super(msg);
        this.code = "500";
        this.msg = msg;
    }

    public InnerException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public InnerException(Exception e) {
        super(e);
        this.code = "500";
        this.msg = e.getMessage();
    }

    public InnerException(String msg, Exception e) {
        super(e);
        this.code = "500";
        this.msg = msg;
    }

    public InnerException(String code, String msg, Exception e) {
        super(e);
        this.code = code;
        this.msg = msg;
    }

}
